package com.cskaoyan.servlet;

import com.cskaoyan.bean.PageData;
import com.cskaoyan.bean.PageData1;
import com.cskaoyan.bean.PageParameter;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.common.CommonServlet;
import com.cskaoyan.service.Impls.OrderServletImpl;
import com.cskaoyan.service.OrderServlet;
import com.cskaoyan.service.RegionServlet;
import com.cskaoyan.service.Impls.RegionServletImpl;
import com.cskaoyan.util.JacksonUtil;
import org.apache.commons.beanutils.BeanUtils;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;

@WebServlet("/admin/order/*")
public class AdminOrderServlet extends CommonServlet {

    public void list(HttpServletRequest request, HttpServletResponse response) throws IOException, InvocationTargetException, IllegalAccessException {
        OrderListParameter parameter = new OrderListParameter();
        Map<String, String[]> parameterMap = request.getParameterMap();

        BeanUtils.copyProperties(parameter, parameterMap);

        PageData data = orderService.list(parameter);

        return BaseRespVo.ok(data);
    }


}
